using System;
using System.Collections.Generic;
using System.Text;

namespace SymAutomate.LetterFile
{
    /// <summary>
    /// Error Numbers 500-509; Reference file ErrorNumbers.txt for more information.
    /// 505 Error: Required argument 'filename' missing. Use /h switch for help.
    /// </summary>
    class Parameters : ParametersBase
    {
        #region Class Variables and Access Methods
        private string __FileName;

        public string FileName { get { return __FileName; } }
        #endregion

        public Parameters(ConsoleArguments _ConsoleArguments, List<ConsoleHelp> _ConsoleHelpList)
            : base(_ConsoleArguments, _ConsoleHelpList)
        {
            //defaults

            //read from config file

            //save from command line arguments
            if (_ConsoleArguments.ArgumentCollection.Contains("filename")) __FileName = _ConsoleArguments.ArgumentCollection["filename"].ToString();


            //perform argument error checking
            if (_ConsoleArguments.ArgumentCollection["command"].ToString().ToLower() == "DeleteLetterFile".ToLower())
            {
                if (string.IsNullOrEmpty(__FileName))
                    throw new ReturnException("505 Error: Required argument 'filename' missing. Use /h switch for help.");
            }
        }
    }
}
